package com.sprouting.personal.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sprouting.personal.annotations.CheckLength;
import com.sprouting.personal.annotations.CheckNotNull;
import com.sprouting.personal.model.common.BaseModel;
import com.sprouting.personal.model.common.jsr.AddGroup;
import com.sprouting.personal.model.common.jsr.UpdGroup;
import lombok.Data;

import javax.validation.constraints.Null;

/**
 * 单词组
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2023/1/3 11:12
 */
@Data
@TableName("ps_word_group")
public class WordGroup extends BaseModel {

    /**
     * 主键
     */
    @TableId
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @Null(message = "无效ID", groups = AddGroup.class)
    private String id;
    /**
     * 用户ID
     * @see User#getId()
     */
    private String userId;
    /**
     * 组名称
     */
    @CheckNotNull(message = "请输入单词组名称")
    @CheckLength(min = 1, max = 200, message = "单词组名称不能为空")
    private String name;
    /**
     * 详情
     */
    @CheckLength(max = 500, message = "单词组详情超过长度限制")
    private String details;

}
